package com.cai.seckill.service;

import com.cai.seckill.common.vo.GoodsVo;
import com.cai.seckill.common.vo.OrderDetailVo;
import com.cai.seckill.pojo.Order;
import com.baomidou.mybatisplus.extension.service.IService;
import com.cai.seckill.pojo.User;

/**
 * <p>
 * 订单表 服务类
 * </p>
 *
 * @author Uli1024
 * @since 2022-08-06
 */
public interface OrderService extends IService<Order> {

    /**
     * 秒杀
     *
     * @param user
     * @param goodsVo
     * @return
     */
    Order seckill(User user, GoodsVo goodsVo);

    /**
     * 验证秒杀地址
     *
     * @param user
     * @param goodsId
     * @param path
     * @return
     */
    boolean checkPath(User user, Long goodsId, String path);

    /**
     * 生成秒杀地址
     *
     * @param user
     * @param goodsId
     * @return
     */
    String createPath(User user, Long goodsId);

    /**
     * 订单详情
     *
     * @param orderId
     * @return
     */
    OrderDetailVo detail(Long orderId);

    /**
     * 校验验证码
     *
     * @param user
     * @param goodsId
     * @param captcha
     * @return
     */
    boolean checkCaptcha(User user, Long goodsId, String captcha);
}
